home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n17.arc
/
WHATNDP.SCR
< prev
Wrap
Text File
|
1990-09-12
|
2KB
|
58 lines
N WHATNDP.COM
A
JMP 0136
DB 0D,0A,"No NDP installed",0D,0A,"$"
DB 0D,0A,"NDP is an 80$"
DB "87$"
DB "287$"
DB "387$"
DB 0D,0A,"$"
DB 0,0
FINIT ;Check for coprocessor
FSTCW [0134] ; by initializing it
CMP BYTE PTR [0135],3 ; and looking at the
JZ 014B ; bits 8 and 9 of the
MOV AH,9 ; control word
MOV DX,0102 ;Exit if there's nothing
INT 21 ; there
RET
MOV AH,9 ;Print opening message
MOV DX,0117
INT 21
MOV DX,0126 ;Test for 8087 by seeing
AND WORD PTR [0134],FF7F ; if the FDISI instruction
WAIT ; sets the IEM bit in the
FLDCW [0134] ; coprocessor control word
WAIT
FDISI
WAIT
FSTCW [0134]
TEST WORD PTR [0134],80
JNZ 018F ;Branch if NDP is an 8087
MOV DX,0129 ;Distinguish between 287
FINIT ; and 387 by determining
FLD1 ; whether the NDP is
FLDZ ; initialized to affine
FDIVP ST(1),ST ; (387) or projective
FLD ST(0) ; (287) infinity
FCHS
FCOMPP
FSTSW [0134]
WAIT
MOV AX,[0134]
SAHF
JZ 018F ;Branch if 287
MOV DX,012D ;It's a 387!
MOV AH,9 ;Print NDP type and exit
INT 21
MOV AH,9
MOV DX,0131
INT 21
RET
RCX
9B
W
Q